package com.codeoss.framework.json;

import java.io.IOException;
import java.sql.Time;
import java.text.SimpleDateFormat;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

public class TimeSerialize extends JsonSerializer<Time> {

	@Override
	public void serialize(Time time, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
			throws IOException, JsonProcessingException {
		// TODO Auto-generated method stub
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
		jsonGenerator.writeString(simpleDateFormat.format(time)); 
	}

}
